﻿Imports System.ComponentModel
Public Class LabeledTextBox
    <Description("The text for the Label"), Category("MyCategory"), DefaultValue("Label")> _
    Public Property Label() As String
        Get
            Return Label1.Text
        End Get
        Set(ByVal value As String)
            Label1.Text = value
        End Set
    End Property

    <Description("The text of the TextBox"), Category("MyCategory"), DefaultValue("")> _
    Public Property Value() As String
        Get
            Return TextBox1.Text
        End Get
        Set(ByVal value As String)
            TextBox1.Text = value
        End Set
    End Property


    Private Sub LabeledTextBox_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize
        Label1.Top = 0
        Label1.Left = 0
        Label1.Height = Me.Height
        Label1.Width = CInt(Me.Width / 3)
        TextBox1.Top = 0
        TextBox1.Left = Label1.Width
        TextBox1.Height = Me.Height
        TextBox1.Width = Me.Width - Label1.Width

    End Sub
End Class
